package kr.hkit.PowerJava.chapter12.work;

public class Person implements Comparable<Person>{
    private String name;
    private int height;
		
	public Person(String name, int i) {
		super();
		this.name = name;
		this.height = height;
	}

	@Override
	
	public int compareTo(Person o) {
		return height-o.height;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getHeight() {
		return height;
	}
	public void setHeight(int height) {
		this.height = height;
	}
	
	@Override
	public boolean equals(Object obj) {
		
		return name.equals(((Person)obj).name);
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return name.hashCode();
	}

	@Override
	public String toString() {
		return String.format("Person [name=%s, height=%s]", name, height);
	}
    
	
}
